package buildermode;

import factorymode.Zh0202Weapon;
import statemode.Zh0202State;

/**
 * @author: zh
 * @date: 2021/12/17 20:31
 * @version: 1.0
 */
public class Zh0202Player {
    /**
     * -    body : String
     * -    custume : String
     * -    weapon : Zh0202Weapon
     * -    state : Zh0202State
     */
    private String body;
    private String custume;
    private Zh0202Weapon weapon;
    private Zh0202State state;

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public String getCustume() {
        return custume;
    }

    public void setCustume(String custume) {
        this.custume = custume;
    }

    public Zh0202Weapon getWeapon() {
        return weapon;
    }

    public void setWeapon(Zh0202Weapon weapon) {
        this.weapon = weapon;
    }

    public Zh0202State getState() {
        return state;
    }

    public void setState(Zh0202State state) {
        this.state = state;
    }

    @Override
    public String toString() {
        return "Zh0202Player{" +
                "body='" + body + '\'' +
                ", custume='" + custume + '\'' + "," + "\n" +
                " weapon=" + weapon + "," + "\n" +
                " state=" + state +
                '}';
    }

    public void behave() {
        System.out.println(this);
    }

    public void attacked() {
        state.attacked();
    }

    public void shotting(){
        state.shoot();
    }

    public void isReady() {
        state.setReady(true);
        state.checkState();
    }
}
